<style>
div.L_chart {
    width: 100%;
    height: 310px;
    margin: 0 auto;
    position: relative;
}
div.L_chart div.L_profit_legend {
    width: 100%;
    padding-top: 26px;
    height: 116px;
}
div.L_chart div.L_profit_legend p{
    color: #a6a8af;
}
div.L_chart div.L_profit_legend p span:nth-child(1){
    font-size: 30px;
    color: #f64747;
    font-weight: bold;
    text-align: left;
    margin-top: 18px;
    margin-bottom: 16px;
    margin-left: 10px;
}
div.L_chart div.L_profit_legend p:nth-child(2) span:nth-child(2) {
    font-size: 16px;
    color: #f64747;
}
div.L_chart div.L_profit_legend p:nth-child(3) {
    font-size: 12px;
    color: #646363;
    text-align: left;
}
</style>
<div class="L_chart">
    <div class="L_profit_legend">
        <p>总收益<span>{{$totalbballpoint}}</span>
            <span>点</span></p>
        <p>EAI分析师收益曲线图</p>
    </div>
    <div id="profit_chart" style="width:100%;height: 310px; margin: auto;"></div>
</div>
<script src="{{ URL::asset('public_js/jquery-1.8.3.min.js')}}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/modules/exporting.js') }}"></script>
<script src="{{ URL::asset('public_js/src/Highcharts-5.0.10/code/highcharts-more.js') }}"></script>
<script>
// 分析师收益曲线图
var xmydata11 = [];
var xmypoint='{{ $totalbbpoint }}';
var xmytime='{{ $totalbbtime }}';
xmytime = xmytime.split(',');
xmypoint = xmypoint.split(',');
xmypoint.forEach(function(data,index,arr){
    xmydata11.push(+data);
});
profitchart(profit_chart,[xmytime,xmydata11]);
function profitchart(id,data){
    var t = this;
    return new Highcharts.Chart({
        chart: {
            renderTo: id,
            type: "areaspline",
            zoomType: "xy",
            backgroundColor:'#161a21'
        },
        title: {
            text: null,
        /*    align: 'right',
            x: 20,
            verticalAlign: 'bottom',
            y: -0*/
        },
        colors: ["#ffc766"],
        legend: {
            enabled: false
        },
        credits: {
            enabled: false
        },
        exporting: {
            enabled:false
        },
        xAxis: {
            gridLineWidth: 0,
            lineColor: "#2b2f36",
            tickColor: "#cccccc",
            gridLineColor: "#2b2f36",
            categories:data[0], //时间数组
            tickInterval: Math.ceil(data[0].length / 7),
            title: {
                text: null,
                align:'middle'
            },
        },
        yAxis: {
            opposite: true, //Y轴在右侧
            gridLineWidth: 1,
            lineColor: "#2b2f36",
            tickColor: "#cccccc",
            gridLineColor: "#2b2f36",
            title: {
                text: null,
                rotation:0,
                align:'middle'
            },
            labels: {
//              formatter: function() {
//                  return a.numberFormat(this.value, 0, ".", ",") + " $"
//              }
            }
        },
        tooltip: {
            style: {
                color: "white"
            },
            borderWidth: 0,
            shadow: !1,
            backgroundColor: "rgba(34,34,34, 0.6)",
            shared: !0
        },
        plotOptions: {
            areaspline: {
                fillColor: {
                    linearGradient: {
                        x1: 0,
                        y1: 0,
                        x2: 0,
                        y2: 1
                    },
                    stops: [
                        [0, "#3b9ce0"],
                        [1, Highcharts.Color("#3b9ce0").setOpacity(0).get('rgba')]
                    ]
                },
                marker: {
                    radius: 0,
                    fillColor: "white",
                    lineWidth: 1,
                    lineColor: "#ffc766"
                },
                lineWidth: 1,
                states: {
                    hover: {
                        lineWidth: 1
                    }
                },
                threshold: null
            },
            series: {
                lineColor: {
                    linearGradient: { //面积图上线条渐变色
                        x1: 0,
                        y1: 0,
                        x2: 0,
                        y2: 1
                    },
                    stops: [
                        [0, "#3b9ce0"],
                        [1, Highcharts.Color("#3b9ce0").setOpacity(0.1).get('rgba')]
                    ]
                }
            }
        },
        series: [{
            name: "盈利点位",
            data: data[1] //数据数组
        }]
    })
}
</script>
